<?php
defined('IN_TS') or die('Access Denied.');
/* 
 * 配置选项
 */	

switch($ts){
	//基本配置
	case "":


        $strOption = fileRead('ask_options.php');
        if($strOption==''){
            $strOption = $tsMySqlCache->get('ask_options');
        }

		include template("admin/options");
		break;


    case "do":

        fileWrite('ask_options.php','data',$_POST['option']);
        $tsMySqlCache->set('ask_options',$_POST['option']);


        //更新APP导航名称
        if($_POST['option']['appname']){
            $appkey = 'ask';
            $appname = $_POST['option']['appname'];
            $arrNav = include 'data/system_appnav.php';
            if(is_array($arrNav)){
                $arrNav[$appkey] = $appname;
            }else{
                $arrNav = array(
                    $appkey=>$appname,
                );
            }
            fileWrite('system_appnav.php','data',$arrNav);
            $GLOBALS['tsMySqlCache']->set('system_appnav',$arrNav);
        }

        qiMsg('修改成功');

        break;

}